﻿using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;

namespace HamcoWcs.DAL.Migrations
{
    public partial class A30 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "communication_log_bak",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false, comment: "主键Id")
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    TransactionId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "消息号")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Direction = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: false, comment: "ex:WCS > MES | WCS < MES")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    MessageType = table.Column<string>(type: "varchar(30)", maxLength: 30, nullable: true, defaultValue: "", comment: "消息类型")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    MessageName = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false, comment: "消息名称")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    MessageStatus = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: true, defaultValue: "", comment: "消息状态")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Content = table.Column<string>(type: "longtext", maxLength: 100, nullable: false, comment: "数据内容")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Return = table.Column<string>(type: "longtext", maxLength: 100, nullable: false, comment: "返回的数据")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    UnitId = table.Column<string>(type: "varchar(30)", maxLength: 30, nullable: true, defaultValue: "", comment: "托盘号")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Sender = table.Column<string>(type: "varchar(30)", maxLength: 30, nullable: true, defaultValue: "", comment: "发送者")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Receiver = table.Column<string>(type: "varchar(30)", maxLength: 30, nullable: true, defaultValue: "", comment: "接收者")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    CreatedTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
                    LastUpdateTime = table.Column<DateTime>(type: "datetime(6)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_communication_log_bak", x => x.Id);
                },
                comment: "消息日志")
                .Annotation("MySql:CharSet", "utf8mb4");
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "communication_log_bak");
        }
    }
}
